﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html>
<html>
  <head>
  	
  	<%@ include file="/WEB-INF/include/meta.jsp" %>
  	<%@ include file="/WEB-INF/include/css.jsp" %>
  	<link href="${ctx.resource}/css/font-awesome.min.css" rel="stylesheet">
  	<link href="${ctx.resource}/css/bootstrap-select.min.css" rel="stylesheet">
	
	<title>投资人入驻 - 众投湾</title>
	
	<fmt:setBundle basename="ApplicationMessage"/>
	<fmt:setLocale value="zh_CN"/>
	
  </head>

  <body>
  
	<%@ include file="/WEB-INF/include/header.jsp" %>
	
	<div class="container clearfix zz-startups">
	  <div class="zz-narrow-wrapper">
	    
	    <div class="zz-narrow-content clearfix">
	      <div class="narrow-nav">
            <div class="list-group list-group-justified no-bottom-margin">
              <a href="javascript: void(0)" class="list-group-item item-large active">
                <i class="fa fa-paper-plane-o fa-2x"></i>投资人入驻
              </a>
              <a href="javascript: void(0)" class="list-group-item item-large disable" title="暂未开放">
                <i class="fa fa-group fa-2x"></i>普通注册
              </a>
            </div>
          </div>
          
          <div class="narrow-box">
            
            <form class="form-horizontal" method="post" action="${ctx}/investors" enctype="multipart/form-data" data-validate="true">
              
              <c:if test="${not empty errorMessage}">
			    <div class="alert alert-danger text-align-center" style="margin-top: 10px;"><i class="glyphicon glyphicon-remove"></i>&nbsp;&nbsp;<fmt:message key="${errorMessage}" /></div>
			  </c:if>
            
              <input type="hidden" name="authority" value="ROLE_INVESTOR">
	    
	          <div class="form-group zz-form-group">
	            <label class="col-xs-3 control-label">登录邮箱</label>
	            <div class="input-group demo2do-input-group col-xs-5">
	              <input type="text" name="email" class="form-control zz-form-control" placeholder="登录邮箱" data-validate="required|email">
	              <span class="input-group-addon"><span class="glyphicon glyphicon-envelope"></span></span>
	            </div>
	          </div>
	          
	          <div class="form-group zz-form-group">
	            <label class="col-xs-3 control-label">真实姓名</label>
	            <div class="input-group demo2do-input-group col-xs-5">
	              <input type="text" name="name" class="form-control zz-form-control" placeholder="真实姓名" data-validate="required">
	              <span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
	            </div>
	          </div>
	          
	          <div class="form-group zz-form-group">
	            <label class="col-xs-3 control-label">登录密码</label>
	            <div class="input-group demo2do-input-group col-xs-5">
	              <input type="password" name="password" id="password" class="form-control zz-form-control" placeholder="登录密码" data-validate="required">
	              <span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
	            </div>
	          </div>
	          
	          <div class="form-group zz-form-group">
	            <label class="col-xs-3 control-label">确认密码</label>
	            <div class="input-group demo2do-input-group col-xs-5">
	              <input type="password" name="confirmPassword" id="confirmPassword" class="form-control zz-form-control" placeholder="确认密码" data-validate="required|match,#password" data-validate-match-message="输入值与登录密码不匹配！">
	              <span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
	            </div>
	          </div>
	          
	          <div class="form-group zz-form-group">
	            <label class="col-xs-3 control-label">入驻机构</label>
	            <div class="col-xs-5 no-padding">
	              <c:choose>
	                <c:when test="${not empty selectedInstitution}">
	                  <p><img src="${ctx.upload}/${selectedInstitution.profile.avatar}" width="48" height="48" style="border: 1px solid #ddd;"/>&nbsp;&nbsp;${selectedInstitution.profile.name}</p>
	                  <input type="hidden" name="institutionId" value="${selectedInstitution.id}">
	                </c:when>
	                <c:otherwise>
	                  <select name="institutionId" class="selectpicker show-tick" data-style="btn-default btn-shadow btn-shadow-default" data-width="100%" data-size="5" data-width="140px">
					    <c:forEach var="institution" items="${institutions}">
					      <option value="${institution.id}" data-img="${ctx.upload}/${institution.profile.avatar}">${institution.profile.name}</option>
					    </c:forEach>
				      </select>
	                </c:otherwise>
	              </c:choose>
	            </div>
	          </div>
	          
	          <div class="form-group zz-form-group">
	            <label class="col-xs-3 control-label">上传名片</label>
	            <div class="col-xs-5 no-padding">
	              <input type="file" name="businessCard" class="filestyle" data-iconName="glyphicon glyphicon-folder-open" data-buttonText="&nbsp;选择文件" data-validate="required">
	            </div>
	          </div>
	          
	          <div class="form-group zz-form-group">
	            <div class="checkbox col-xs-offset-3">
	              <label><input type="checkbox" checked disabled>阅读并同意众投湾的<a href="#">《服务协议》</a></label>
	            </div>
	          </div>
	          
	          <div class="form-group zz-form-group">
	            <div class="input-group col-xs-offset-3 col-xs-5">
	              <button type="submit" class="btn btn-success btn-shadow btn-shadow-success demo2do-input-full-width">完成注册</button>
	            </div>
	          </div>
	    
	        </form>
            
          </div>
	    </div>
	    
	  </div>
	  
	
	</div>
	
	<%@ include file="/WEB-INF/include/footer.jsp" %>
	<%@ include file="/WEB-INF/include/script.jsp" %>
	<script src="${ctx.resource}/js/bootstrap-select.js"></script>
	<script src="${ctx.resource}/js/bootstrap-filestyle.min.js"></script>
	<script src="${ctx.resource}/js/bootstrap.validate.js"></script>
	<script src="${ctx.resource}/js/bootstrap.validate.en.js"></script>
	<script src="${ctx.resource}/js/bootstrap-validate-trigger.js"></script>
	
	<script>
	  
	  $(function() {
		$('.selectpicker').selectpicker();
	    
		$('.zz-form-control').focus(function() {
		  $(this).parent().addClass('active');
		}).blur(function() {
		  $(this).parent().removeClass('active');
		});
		
	  });
	
	</script>
    
  </body>
  
</html>
